#coding: GBK
require "rubygems"
require "watir"
require "test/unit"
require "win32ole"

class Opentc < Test::Unit::TestCase
	def setup
		@ie = Watir::IE.new
		 url ="http://open.shouji.baidu.com/?page=miopen"
		#url	=	"http://db-wise-rdtf0.db01.baidu.com:8080/?page=miopen"
		
		url="http://tc-wise-rc-tf10.vm.baidu.com:8088/?page=miopen"
		@ie.goto url
	end
	def test_foot
		sitekey='7000109a'
		user='test2012'
		sleep(1)
		@ie.text_field(:id,"PassInputUsername0").set "souldak_2036" 
		@ie.text_field(:id,"PassInputPassword0").set "hbl4217121"
		@ie.button(:type,"submit").click
		sleep(1)
		@ie.div(:class,"logined-holder").link(:index,1).click
		sleep(1)
		@ie.ul(:class => 'clearfix').link(:index,4).click
		sleep(1)
		@ie.text_field(:name => 'site_key').set sitekey
		@ie.button(:type => 'submit').click
		sleep(1)
		p @ie.div(:class =>'stats-title').span(:index,2).text
		@ie.div(:class => 'stats-nav').link(:index,1).click
		sleep(1)
		@ie.image(:class => 'ui-datepicker-trigger').click
		sleep(3)
		p @ie.link(:class => 'ui-state-default ui-state-highlight ui-state-active').text
		
	end
end